package com.woniuxy.controller;

import com.woniuxy.entity.RbacManager;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.ManagerLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//登录controller，我们不走shiro，我们只返回token
@RestController
public class ManagerLogin {
    @Autowired(required = false)
    ManagerLoginService managerLoginService;
    @RequestMapping("/login")
    public ResponseEntity login(@RequestBody RbacManager rbacManager){
        //登录成功后，需要生成token返回给前端
        return managerLoginService.login(rbacManager);
    }
}
